package com.game.hall.jpb;

import com.game.net.client.jpbsocket.JPbSocketNettyClient;
import com.game.message.Msg;
import com.game.message.jpb.JPbUtil;
import com.game.messagebean.common.DemoJPB;

/**
 * Created by legend9999 on 2016/6/26.
 */
public class JPbClientMain {
    public static void main(String[] args) throws InterruptedException {
        new Thread(new Runnable() {
            public void run() {
                JPbSocketNettyClient jPbSocketNettyClient = new JPbSocketNettyClient();
                try {
                    jPbSocketNettyClient.init("127.0.0.1", 9001);
                    DemoJPB stt = new DemoJPB();
                    stt.setMsgId(21212121);
                    stt.setValue(2122);
                    stt.setName("fdsa");
                    Msg msg = JPbUtil.getMsg(DemoJPB.class,stt);

                    jPbSocketNettyClient.write(msg);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }
}
